x86 hvm: fix missing ticks bug of c/s 20218
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 22 Sep 2009 07:00:36 +0000 (08:00 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 22 Sep 2009 07:00:36 +0000 (08:00 +0100)
With c/s 20218, timer ticks might be missed when IRQs of a timer are
queued. "Next scheduled time" is accumulated wrongly.

Thanks to Christoph for the report.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
Reported-by: Christoph Egger <Christoph.Egger@amd.com>
xen/arch/x86/hvm/vpt.c

index 1a5804a3564b6be0b1adbb10526570dc784dceab..5ed13620820ec18af932cafa260598cc3d9eb421 100644 (file)
@@ -309,7 +309,6 @@ void pt_intr_post(struct vcpu *v, struct hvm_intack intack)
     else
     {
         pt->scheduled += pt->period;
-        pt_process_missed_ticks(pt);
 
         if ( mode_is(v->domain, one_missed_tick_pending) ||
              mode_is(v->domain, no_missed_ticks_pending) )
@@ -324,7 +323,11 @@ void pt_intr_post(struct vcpu *v, struct hvm_intack intack)
         }
 
         if ( pt->pending_intr_nr == 0 )
+        {
+            pt_process_missed_ticks(pt);
+            pt->do_not_freeze = 0;
             set_timer(&pt->timer, pt->scheduled);
+        }
     }
 
     if ( mode_is(v->domain, delay_for_missed_ticks) &&